<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>index</title>
    <link rel="stylesheet" href="/bootstrap/css/bootstrap.css">
    <script src="/bootstrap/js/jquery.min.js"></script>
    <script src="/bootstrap/js/bootstrap.min.js"></script>

    <link rel="stylesheet" href="/angularjs/pagination.css">
    <script src="/angularjs/angular.min.js"></script>
    <script src="/angularjs/pagination.js"></script>

    <link rel="stylesheet" href="/layer/layer/theme/default/layer.css">
    <script src="/layer/layer/layer.js"></script>

</head>

<style>
    /* reset.css */
    body {
        font-size: 12px !important;
        font-family: 'Microsoft Yahei', 'proxima-nova', helvetica, arial;
        -webkit-overflow-scrolling: touch;
    }

    section {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
        padding: 0;
        margin: 0;
    }

    h5 {
        font-style: normal;
        font-weight: normal;
    }

    img {
        border: 0;
        display: block;
        border: 0;
    }

    .clearfix:after {
        content: '';
        display: block;
        visibility: hidden;
        height: 0;
        clear: both;
    }

    .clearfix {
        zoom: 1;
    }

    a {
        text-decoration: none;
        color: #969696;
    }

    a:hover {
        color: #fed503;
        text-decoration: none;
    }

    ul,
    ol {
        list-style: none;
    }

    a {
        outline: none;
    }

    /* 去掉 input 右边上下箭头 */
    input::-webkit-outer-spin-button,
    input::-webkit-inner-spin-button {
        -webkit-appearance: none !important;
        margin: 0;
    }

    input:-webkit-autofill {
        -webkit-box-shadow: 0 0 0px 1000px white inset !important;
    }

    /* 项目样式 */
    .process-status-new {
        width: 50%;
        background-color: #fff;
        height: 46px;
        padding-top: 24px;
        margin-left: 25%;
    }

    .process-status-new ul {
        margin: 0 36px;
        border-top: 1px solid #e5e5e5;
        height: 45px;
        position: relative;
    }

    .process-status-new ul li {
        position: absolute;
        float: left;
        width: 50%;
        top: -12px;
    }

    .process-status-new ul .p-gjj {
        left: 0;
    }

    .process-status-new ul .p-basic {
        left: 50%;
    }

    .process-status-new ul .p-edu {
        left: 100%;
    }

    /*.process-status-new ul .p-ok {*/
    /*    left: 100%;*/
    /*}*/

    /*.process-status-new .p-n-2 .p-basic span.l,*/
    /*.process-status-new .p-n-2 .p-gjj span.l,*/
    /*.process-status-new .p-n-3 .p-gjj span.l,*/
    /*.process-status-new .p-n-4 .p-gjj span.l */
    .jjjj {
        display: block !important;
    }

    .process-status-new ul li span.l {
        position: absolute;
        left: 0;
        top: 11px;
        width: 100%;
        z-index: 1;
        display: none;
        height: 1px;
        background-color: #439df8;
    }

    .process-status-new ul li .box {
        width: 88px;
        position: relative;
        margin-left: -44px;
        z-index: 2;
    }

    /*.process-status-new .p-n-2 .p-basic .icon span,*/
    /*.process-status-new .p-n-2 .p-gjj .icon span,*/
    /*.process-status-new .p-n-3 .p-gjj .icon span,*/
    /*.process-status-new .p-n-4 .p-gjj .icon span */
    .jingdu1 {
        background-image: url(http://r.51gjj.com/image/static/20160518-bank-icon-cur2.png);
        background-size: 12px 12px;
        background-color: #ffffff;
        border: 2px solid #439df8 !important;
    }

    .process-status-new ul li .box .icon {
        width: 21px;
        height: 21px;
        padding: 1px;
        background-color: #fff;
        margin: 0 auto;
    }

    .process-status-new .p-n-2 .p-gjj p,
    .process-status-new .p-n-3 .p-gjj p,
    .process-status-new .p-n-4 .p-gjj p {
        color: #439df8;
    }

    .process-status-new ul li .box p {
        color: #b9b9b9;
        font-size: 12px;
        padding-top: 6px;
        line-height: 18px;
        text-align: center;
    }

</style>

<script>
    var app = angular.module('myapp', []);
    app.controller('controller', function ($scope, $http) {

            // 查询下拉框内容(selected)的函数
            $scope.selectedmarital = function () {

                $http.get("/selected/getmarital").success(function (data) {

                    $scope.maritallist = data;
                })
            };
            $scope.selectedcity = function () {

                $http.get("/selected/getcity").success(function (data) {

                    $scope.citylist = data;
                })
            };

            $scope.selectednation = function () {
                $http.get("/selected/getnation").success(function (data) {

                    $scope.nationlist = data;
                })
            };

            $scope.selectededulevel = function () {
                $http.get("/selected/getlevel").success(function (data) {

                    $scope.levellist = data;
                })
            };

            $scope.selectedcity = function () {
                $http.get("/selected/getcity").success(function (data) {

                    $scope.citylist = data;
                })
            };

            $scope.selectedquestion = function () {

                $http.get("/selected/getquestion").success(function (data) {

                    $scope.questionlist = data;
                })
            };

            $scope.selectednature = function () {
                $http.get("/selected/getnature").success(function (data) {

                    $scope.naturelist = data;
                })
            };

            $scope.selectedindustry = function () {


                $http.get("/selected/getindustry").success(function (data) {

                    $scope.industrylist = data;
                })
            };

            $scope.selectedMethod = function () {


                $http.get("/selected/getmethod").success(function (data) {

                    $scope.methodlist = data;
                })
            };

            $scope.selectedposition = function () {

                $http.get("/selected/getposition").success(function (data) {

                    $scope.positionlist = data;
                })
            };

            $scope.selectedknowsbook = function () {

                $http.get("/selected/getknowsbook").success(function (data) {

                    $scope.knowsbook = data;
                })
            };


            // <span ng-show="myForm.myAddress.$error.email">不是一个合法的邮箱地址</span>

            //click函数 发送验证码 提交表单等
            // 倒计时重新发送验证码
            $scope.Countdown = function (timer, obj) {
                if (timer >= 1) {
                    obj.attr("disabled", true).text("重新发送(" + timer + ")");
                    timer--;
                    setTimeout(function () {
                        $scope.Countdown(timer, obj);
                    }, 1000);
                } else {
                    obj.attr("disabled", false).text("重新发送");
                }
            };
            // 请求后台发送验证码
            $scope.sendcode = function () {

                var mail = $("#phonenumber").val();
                $http.get("/shenqin/sendcode?number=" + mail).success(function (data) {
                    // 重新发送倒计时
                    if (data.toString() === "true") {
                        alert("验证码为123456")
                        timer = 60;
                        $scope.Countdown(timer, obj = $("#sendcode"));
                    } else {
                        alert("请先登录")
                    }
                });


            };


            // 验证码和三个表单的提交时原子操作 都放在一个方法中 由于angular提交的数局都看成了一个对象 使用map
            $scope.submit = function () {

                $scope.datamap = {
                    code: $scope.checkcode,
                    contact: $scope.contact,
                    unitinfortion: $scope.unitinfortion,
                    essential: $scope.essential,
                    typeid: localStorage.getItem("typeid")
                };
                $http.post("/shenqin/submit", $scope.datamap).success(function (data) {
                    layer.msg(data);
                    var url = "/shenqin/toresult?data=" + data;
                    location.href = url;
                });
            };


        }
    );

</script>
<body ng-app="myapp" ng-controller="controller">
<div class="container">
    <div class="panel">
        <div class="panel-heading text-center"><h1 style="color: #1E9FFF">信息填写页面</h1></div>
        <div class="panel-body">
            <div class="panelbox">
                <div class="row">
                    <ul class="nav nav-pills">
                        <li role="presentation" id="li1" class="active"><a href="#">基本信息填写</a></li>
                        <li role="presentation" id="li2"><a href="#">单位信息填写</a></li>
                        <li role="presentation" id="li3"><a href="#">联系人信息填写</a></li>
                    </ul>
                </div>
                <div class="frombox">

                    <!-------------基本信息填写表单开始------------------->
                    <form id="1" name="form1" class="form-horizontal">
                        <div class="text-center">
                            <h3>基本信息填写</h3>
                        </div>

                        <div class="form-group">
                            <label for="realname" class="col-sm-2 control-label">姓名</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" id="realname"
                                       required ng-model="essential.realname" name="realname"
                                       placeholder="姓名">

                                <span style="color:red" ng-show="form1.realname.$dirty && form1.realname.$invalid">
                                     <span style="color:red" ng-show="form1.realname.$error.required">**此项为必填项**
                                     </span>
                                </span>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="identityId" class="col-sm-2 control-label">证件号</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="identityId" id="identityId" required
                                       ng-model="essential.identityId" placeholder="身份证号码">

                                <span style="color: red"
                                      ng-show="form1.identityId.$viewValue.length<18">请输入正确的身份证号
                                </span>

                                <span style="color: red"
                                      ng-show="form1.identityId.$viewValue.length>18">请输入正确的身份证号
                                </span>

                                <span style="color:red" ng-show="form1.identityId.$dirty && form1.identityId.$invalid">
                                     <span style="color:red" ng-show="form1.identityId.$error.required">**此项为必填项**
                                     </span>
                                </span>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="type" class="col-sm-2 control-label">证件类型</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" id="type" value="身份证" readonly>
                            </div>
                        </div>


                        <div class="form-group">
                            <label for="phonenumber" class="col-sm-2 control-label">手机号码</label>
                            <div class="col-sm-10">
                                <input type="number" class="form-control" id="phonenumber" required
                                       ng-model="essential.phonenumber" name="phonumber"
                                       placeholder="请输入手机号码">
                                <a type="text" ng-click="sendcode()" id="sendcode" class="form-control btn btn-primary">
                                    获取验证码</a>
                                <span style="color: red"
                                      ng-show="form1.phonumber.$viewValue.length<11">请输入正确的手机号
                                </span>
                                <span style="color: red"
                                      ng-show="form1.phonumber.$viewValue.length>11">请输入正确的手机号
                                </span>
                                <span style="color:red" ng-show="form1.phonumber.$dirty && form1.phonumber.$invalid">
                                     <span style="color:red" ng-show="form1.phonumber.$error.required">**此项为必填项**
                                     </span>
                                </span>

                            </div>
                        </div>

                        <div class="form-group">

                            <label for="checkcode" class="col-sm-2 control-label">验证码</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" id="checkcode" required
                                       name="checkcode"
                                       ng-model="checkcode" placeholder="验证码">

                                <span style="color:red" ng-show="form1.checkcode.$dirty && form1.checkcode.$invalid">
                                     <span style="color:red" ng-show="form1.checkcode.$error.required">**此项为必填项**
                                     </span>
                                </span>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="nation" class="col-sm-2 control-label">民族</label>
                            <div class="col-sm-10">
                                <select id="nation" class="form-control" ng-init="selectednation()"
                                        ng-model="essential.nationname" name="nation"
                                        ng-options="a.nid as a.nationname for a in nationlist">
                                </select>

                            </div>
                        </div>

                        <div class="form-group">
                            <label for="marital" class="col-sm-2 control-label">婚姻状况</label>
                            <div class="col-sm-10">
                                <select id="marital" class="form-control" ng-init="selectedmarital()"
                                        ng-model="essential.maritalid" name="maritalid"
                                        ng-options=" b.mid as b.status for b in maritallist">
                                </select>

                            </div>
                        </div>

                        <!--<div class="form-group">-->
                        <!--<label for="timeout" class="col-sm-2 control-label">证件有效期</label>-->
                        <!--<div class="col-sm-10">-->
                        <!--<input type="text" class="form-control" ng-model="essential.timeout"-->
                        <!--id="timeout"-->
                        <!--placeholder="证件有效期">-->
                        <!--</div>-->
                        <!--</div>-->

                        <div class="form-group">
                            <label for="educationid" class="col-sm-2 control-label">教育程度</label>
                            <div class="col-sm-10">
                                <select id="educationid" class="form-control" ng-init="selectededulevel()"
                                        ng-model="essential.educationid" name="educationid"
                                        ng-options="c.educationid as c.level for c in levellist">
                                </select>

                            </div>
                        </div>

                        <div class="form-group">
                            <label for="question" class="col-sm-2 control-label">安全问题</label>
                            <div class="col-sm-10">
                                <select id="question" class="form-control" ng-init="selectedquestion()" required
                                        ng-model="essential.questionid" name="question"
                                        ng-options="d.questionid as d.question for d in questionlist">
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="answer" class="col-sm-2 control-label">问题答案</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" id="answer"
                                       name="answer"
                                       required ng-model="essential.answer"
                                       placeholder="问题答案">
                                <span style="color:red" ng-show="form1.answer.$dirty && form1.answer.$invalid">
                                     <span style="color:red" ng-show="form1.question.$error.required">**此项为必填项**
                                     </span>
                                </span>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="address" class="col-sm-2 control-label">现居住地</label>
                            <div class="col-sm-10">
                                <select id="address" class="form-control" ng-init="selectedcity()"
                                        ng-model="essential.cityid" required
                                        ng-options="e.cityid as e.city for e in citylist">
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="house" class="col-sm-2 control-label">住宅状况</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" id="house"
                                       name="house"
                                       ng-model="essential.house" placeholder="住宅状况">
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="postnum" class="col-sm-2 control-label">邮政编码</label>
                            <div class="col-sm-10">
                                <input type="number" class="form-control" id="postnum"
                                       name="postnum"
                                       ng-model="essential.postnum" placeholder="邮政编码">
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-4" style="float: left">

                            </div>
                            <div class="col-sm-offset-2 col-sm-4" style="float: right">
                                <a onclick="test()" id="b1" type="button" class="btn btn-primary">下一步☛</a>
                            </div>
                        </div>
                    </form>
                    <!-------------基本信息填写表单结束------------------->

                    <!--------------------单位信息填写表单开始------------------------>
                    <form id="2" name="form2" class="form-horizontal" style="display: none">

                        <div class="text-center">
                            <h3>单位信息填写</h3>
                        </div>

                        <div class="form-group">
                            <label for="unitname" class="col-sm-2 control-label">单位名称</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="unitname"
                                       required ng-model="unitinfortion.unitname"
                                       id="unitname" placeholder="单位名称">
                                <span style="color:red" ng-show="form2.unitname.$dirty && form2.unitname.$invalid">
                                     <span style="color:red" ng-show="form2.unitname.$error.required">**此项为必填项**
                                     </span>
                                     </span>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="natureid" class="col-sm-2 control-label">单位性质</label>
                            <div class="col-sm-10">
                                <select class="form-control" id="natureid" ng-init="selectednature()"
                                        required ng-model="unitinfortion.natureid"
                                        ng-options="x.natureid as x.nature for x in naturelist">
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="unitphone" class="col-sm-2 control-label">单位电话</label>
                            <div class="col-sm-10">
                                <input type="number" class="form-control" id="unitphone" name="unitphone"
                                       required ng-model="unitinfortion.unitphone" placeholder="如:8471123">

                                <span style="color: red"
                                      ng-show="form2.unitphone.$viewValue.length<7">请输入正确的电话号码
                                </span>
                                <span style="color: red"
                                      ng-show="form2.unitphone.$viewValue.length>7">请输入正确的电话号码
                                </span>
                                <span style="color:red" ng-show="form2.unitphone.$dirty && form2.unitphone.$invalid">
                                     <span style="color:red" ng-show="form2.unitphone.$error.required">**此项为必填项**
                                     </span>
                                </span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="industryid" class="col-sm-2 control-label">发展行业</label>
                            <div class="col-sm-10">
                                <select id="industryid" class="form-control" ng-init="selectedindustry()"
                                        name="industryid"
                                        ng-model="unitinfortion.industryid"
                                        ng-options="x.industryid as x.industryname for x in industrylist">
                                </select>

                            </div>
                        </div>

                        <div class="form-group">
                            <label for="uaddress" class="col-sm-2 control-label">单位地址</label>
                            <div class="col-sm-10">
                                <select class="form-control" ng-init="selectedcity()" id="uaddress"
                                        ng-model="unitinfortion.cityid"
                                        ng-options="x.cityid as x.city for x in citylist">
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="postonid" class="col-sm-2 control-label">担任职务</label>
                            <div class="col-sm-10">
                                <select class="form-control" ng-init="selectedposition()" id="postonid"
                                        ng-model="unitinfortion.positonid" name="positonid"
                                        ng-options="x.positionid as x.positionname for x in positionlist">
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="annulincome" class="col-sm-2 control-label">年收入</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="annualincome"
                                       required ng-model="unitinfortion.annualincome"
                                       id="annulincome" placeholder="年收入">
                                <span style="color:red"
                                      ng-show="form2.annualincome.$dirty && form2.annualincome.$invalid">
                                     <span style="color:red" ng-show="form2.annualincome.$error.required">**此项为必填项**
                                     </span>
                                </span>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="upostnumber" class="col-sm-2 control-label">单位邮政编码</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" ng-model="unitinfortion.upostnumber"
                                       name="upostnumber"
                                       id="upostnumber" placeholder="单位所在地邮政编码">
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-4" style="float: left">
                                <a class="btn btn-primary" id="b21">☚上一步</a>
                            </div>
                            <div class="col-sm-offset-2 col-sm-4" style="float: right">
                                <a class="btn btn-primary" id="b22">下一步☞</a>
                            </div>
                        </div>
                    </form>
                    <!--------------------单位信息填写表单结束------------------------->

                    <!--------------------联系人信息填写表单开始----------------------->
                    <form id="3" name="myForm3" class="form-horizontal" style="display: none">


                        <div class="text-center">
                            <h3>联系人信息填写</h3>
                        </div>
                        <div class="form-group">
                            <label for="contactname" class="col-sm-2 control-label">联系人姓名</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" ng-model="contact.contactName" required
                                       name="contactName" id="contactName"
                                       placeholder="联系人姓名">
                            </div>

                            <span style="color:red"
                                  ng-show="myForm3.contactName.$dirty && myForm3.contactName.$invalid">

                                <span style="color:red" ng-show="myForm3.contactName.$error.required">**此项为必填项**
                                     </span>
                            </span>
                        </div>

                        <div class="form-group">
                            <label for="contactPhone" class="col-sm-2 control-label">联系人电话</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" ng-model="contact.contactPhone" required
                                       name="contactPhone" id="contactPhone"
                                       placeholder="联系人电话">
                            </div>

                            <span style="color: red"
                                  ng-show="myForm3.contactPhone.$viewValue.length<11">请输入正确的手机号码
                                </span>
                            <span style="color: red"
                                  ng-show="myForm3.contactPhone.$viewValue.length>11">请输入正确的手机号码
                                </span>
                            <span style="color:red"
                                  ng-show="myForm3.contactPhone.$dirty && myForm3.contactPhone.$invalid">

                                <span style="color:red" ng-show="myForm3.contactPhone.$error.required">**此项为必填项**
                                     </span>
                            </span>

                        </div>

                        <div class="form-group">
                            <label for="contactRelation" class="col-sm-2 control-label">与申请人的关系</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" required
                                       name="contactRelation" ng-model="contact.contactRelation"
                                       id="contactRelation" placeholder="与申请人的关系">

                                <span style="color:red"
                                      ng-show="myForm3.contactRelation.$dirty && myForm3.contactRelation.$invalid">
                                    <span style="color:red"
                                          ng-show="myForm3.contactRelation.$error.required">**此项为必填项**</span>

                                     </span>
                            </div>

                        </div>
                        <div class="form-group">
                            <label for="email" class="col-sm-2 control-label">E-Mail地址</label>
                            <div class="col-sm-10">
                                <input type="email" class="form-control" ng-model="contact.email" name="email"
                                       id="email" required
                                       placeholder="E-Mail地址">
                                <span style="color:red" ng-show="myForm3.email.$error.email">
		                                {{myForm3.myEmail.$viewValue}} 不是一个合法的邮箱地址</span>
                                <span style="color:red"
                                      ng-show="myForm3.email.$dirty && myForm3.email.$invalid">
                                    <span ng-show="myForm3.email.$error.required">**此项为必填项**</span>
                                     </span>

                            </div>
                        </div>

                        <div class="form-group">
                            <label for="autopaycount" class="col-sm-2 control-label">自动还款账户</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" ng-model="contact.autopayCount"
                                       required name="autopayCount"
                                       id="autopayCount" placeholder="自动还款账户">
                            </div>

                            <span style="color: red"
                                  ng-show="myForm3.autopayCount.$viewValue.length<16">请输入正确的银行卡号
                                </span>
                            <span style="color:red"
                                  ng-show="myForm3.autopayCount.$dirty && myForm3.autopayCount.$invalid">
                                    <span style="color:red"
                                          ng-show="myForm3.autopayCount.$error.required">**此项为必填项**</span>

                                     </span>
                        </div>

                        <div class="form-group">
                            <label for="methodid" class="col-sm-2 control-label">卡片领取方式</label>
                            <div class="col-sm-10">
                                <select id="methodid" required name="methodid" class="form-control"
                                        ng-init="selectedMethod()"
                                        ng-model="contact.methodid"
                                        ng-options=" x.methodid as x.method for x in methodlist">
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="knowsbook" class="col-sm-2 control-label">知情书</label>
                            <div class="col-sm-10">
                                <textarea required name="knowsbook" class="form-control" id="knowsbook"
                                          ng-model="knowsbook"
                                          placeholder="知情书:您随便读读吧 这是我随便写写的
                                我们最终会由专业的工作人员 仔细的审核你的申请 并及时给出结果与反馈" ng-init="selectedknowsbook()" readonly>

                                </textarea>
                            </div>


                            <div class="book-agree text-center">
                                <input type="checkbox" required name="checkbox" id="checkbox"
                                       ng-model="contact.knowsbook"
                                       placeholder="知情书">
                                <label for="checkbox">
                                    <i></i>
                                    <p>
                                        <span>我已阅读《</span>
                                        <a href="javascript:">知情同意书</a>
                                        <span>》</span>
                                    </p>
                                </label>
                                <span style="color:red"
                                      ng-show="myForm3.checkbox.$error.required">**请仔细阅读知情书 阅读完毕勾选已知悉**</span>

                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-4" style="float: left">
                                <a class="btn btn-primary" id="b31">☜上一步</a>
                            </div>
                            <div class="col-sm-offset-2 col-sm-4" id="end" style="float: right;display: none">
                                <a onclick="form3()" class="btn btn-sm btn-primary" id="b32">☟确认提交☟</a>
                                <a hidden ng-click="submit()" id="gosubmit"></a>
                            </div>
                        </div>

                    </form>
                    <!---------=====-------联系人信息填写表单结束---------==------------->

                </div>
                <div class="lie text-center" style="float: left">
                    <a href="/shenqin/tobankashenqing" class="btn btn-sm btn-success">重新选卡</a>
                </div>
            </div>
            <!--非空提示-->
            <script>

                // onblur函数 检验身份证号 手机号 银行卡号和一些倒计时的函数都使用angular js了


                var selectArr1 = ["question", "address"];

                // form1
                var inputArr1 = ["realname", "identityId", "phonenumber", "checkcode", "answer"];

                function realname() {
                    if ($("#realname").val() == '') {
                        layer.msg("姓名为必填项")
                    }
                }

                $("#realname").blur(function () {
                    realname();
                });

                function identityId() {
                    if ($("#identityId").val() == '') {
                        layer.msg("身份证号为必填项")
                    }
                }

                $("#identityId").blur(function () {
                    identityId();
                });

                function phonenumber() {
                    if ($("#phonenumber").val() == '') {
                        layer.msg("手机号码为必填项")
                    }
                }

                $("#phonenumber").blur(function () {
                    phonenumber();
                });

                function checkcode() {
                    if ($("#checkcode").val() == '') {
                        layer.msg("请输入验证码")
                    }
                }

                $("#checkcode").blur(function () {
                    checkcode();
                });

                function answer() {
                    if ($("#answer").val() == '') {
                        layer.msg("请填写问题答案")
                    }
                }

                $("#answer").blur(function () {
                    answer();
                });
                // form2
                var inputArr2 = ["unitname", "unitphone", "annualincome"];

                var selectArr2 = ["uaddress", "natureid"];

                function unitname() {
                    if ($("#unitname").val() == '') {
                        layer.msg("单位名称为必填项")
                    }
                }

                $("#unitname").blur(function () {
                    unitname();
                });


                function uaddress() {
                    if ($("#uaddress").value === "") {
                        layer.msg("请选择您的单位地址")
                    }
                }

                $("#uaddress").click(function () {
                    uaddress();
                });

                function natureid() {
                    if ($("#natureid").value === "") {
                        layer.msg("选择您的单位性质")
                    }
                }

                $("#natureid").click(function () {
                    natureid();
                });


                function unitphone() {
                    if ($("#unitphone").val() == '') {
                        layer.msg("单位电话为必填项")
                    }
                }

                $("#unitphone").blur(function () {
                    unitphone();
                });

                function annualincome() {
                    if ($("#annualincome").val() == '') {
                        layer.msg("年收入为必填项")
                    }
                }

                $("#annualincome").blur(function () {
                    annualincome();
                });
                // form3
                var inputArr3 = ["contactName", "contactPhone", "contactRelation", "autopayCount", "email"];

                var selectArr3 = ["methodid"];

                function methodid() {
                    if ($("#methodid").value === "") {
                        layer.msg("请选择您的领卡方式")
                    }
                }

                $("#methodid").click(function () {
                    methodid();
                });

                function contactName() {
                    if ($("#contactName").val() == '') {
                        layer.msg("联系人姓名为必填项")
                    }
                }

                $("#contactName").blur(function () {
                    contactName();
                });

                function contactPhone() {
                    if ($("#contactPhone").val() == '') {
                        layer.msg("联系人电话为必填项")
                    }
                }

                $("#contactPhone").blur(function () {
                    contactPhone();
                });

                function contactRelation() {
                    if ($("#contactRelation").val() == '') {
                        layer.msg("与联系人的关系为必填项")
                    }
                }

                $("#contactRelation").blur(function () {
                    contactRelation();
                });

                function autopayCount() {
                    if ($("#autopayCount").val() == '') {
                        layer.msg("还款账户为必填项")
                    }
                }

                $("#autopayCount").blur(function () {
                    autopayCount();
                });

                function email() {
                    if ($("#email").val() == '') {
                        layer.msg("邮箱为必填项")
                    }
                }

                $("#email").blur(function () {
                    email();
                });

            </script>
            <!--非空检查-->
            <script>
                // 检查一个表单是否还存在必填的input字段没填
                function toIdCheck(namelist) {
                    for (var i = 0; i < namelist.length; i++) {
                        if ($("#" + namelist[i]).val() == '') {
                            // namelist[i]();
                            alert("请完成信息的填写");
                            return false;
                        }
                    }
                    return true;
                }

                // 检查一个表单是否还存在必选的select字段没选
                function sltCheck(selelist) {
                    for (var i = 0; i < selelist.length; i++) {
                        var slt = document.getElementById(selelist[i]);
                        if (slt.value === "") {
                            alert("请完善信息的填写");
                            return false;
                        }
                    }
                    return true;
                }

                // form1
                function form1() {
                    var iput = toIdCheck(inputArr1);
                    var sele = sltCheck(selectArr1);
                    if (iput) {
                        if (sele) {
                            return true;

                        }
                        return false;
                    }
                    return false;

                }

                // form2
                function form2() {
                    var iput = toIdCheck(inputArr2);
                    var sele = sltCheck(selectArr2);
                    if (iput) {
                        if (sele) {
                            return true;

                        }
                        return false;
                    }
                    return false;
                }

                // form3
                function form3() {
                    if (form2()) {
                        if (form1()) {
                            var iput = toIdCheck(inputArr3);
                            var sele = sltCheck(selectArr3);
                            if (iput) {
                                if (sele) {
                                    $("#gosubmit").click()
                                } else {
                                    layer.msg("请完成当前页面的信息填写")

                                }
                            } else {
                                layer.msg("请完成当前页面的信息填写")

                            }
                        } else {
                            layer.msg("请完成当前页面的信息填写")

                        }
                    } else {
                        layer.msg("请完成当前页面的信息填写")

                    }

                }
            </script>
            <!-- 样式控制-->
            <script>

                $("#checkbox").click(function () {
                    if ($("input[type='checkbox']").is(':checked')) {
                        $("#end").show("true");
                    } else {
                        $("#end").hide("true");
                    }

                });


                function test() {

                    if (form1()) {
                        show2();
                        active2();
                    }


                }

                $("#b22").click(function () {
                    if (form2()) {
                        show3();
                        active3();
                    }

                });
                $("#b21").click(function () {
                    show1();
                    active1();
                });
                $("#b31").click(function () {
                    show2();
                    active2();
                });

                $("#li1").click(function () {
                    show1();
                    active1();
                });

                $("#li2").click(function () {
                    if (form1()) {
                        show2();
                        active2();
                    } else {
                        layer.msg("请完成当前页面的信息填写")

                    }


                });

                $("#li3").click(function () {
                    if (form1()) {
                        if (form2()) {
                            show3();
                            active3();
                        }
                        else {
                            layer.msg("请完成当前页面的信息填写")

                        }
                    }
                    else {
                        layer.msg("请完成当前页面的信息填写")

                    }

                });

                function show2() {
                    hide1();
                    hide3();
                    $("#2").show("true");

                }

                function show1() {
                    hide2();
                    hide3();
                    $("#1").show("true");

                }

                function show3() {
                    hide2();
                    hide1();
                    $("#3").show("true");

                }

                function hide2() {
                    $("#2").hide("true");
                }

                function hide3() {
                    $("#3").hide("true");
                }

                function hide1() {
                    $("#1").hide("true");
                }

                function active1() {
                    $("#li2").removeClass("active");
                    $("#li3").removeClass("active");
                    $("#li1").addClass("active");
                }

                function active3() {
                    $("#li2").removeClass("active");
                    $("#li1").removeClass("active");
                    $("#li3").addClass("active");
                }

                function active2() {
                    $("#li1").removeClass("active");
                    $("#li3").removeClass("active");
                    $("#li2").addClass("active");
                }


            </script>
        </div>

        <div class="panel-footer"></div>
    </div>
</div>
</body>
</html>